﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using UIControllTool;

namespace Function.ModuleTestFunction {
    [ToolCreateUserControlAttribute]
    public class ModuleTestFunctionConfig : InitUserControl, InitUserControlInterface {
        public static DataTable ModuleTaskData;
        public static DataTable ModuleBrowserData;
        public ModuleTestFunctionConfig() {
            FunctionName = "ModuleTest";
        }
        public void InitUserControlImpl() {
            //初始化内容
            IntiControlData();


            ModuleTestFunction moduleTestFunction = new ModuleTestFunction();
            AntdUI.Panel FunctionListPanel = Tool.GetControlByForm<AntdUI.Panel>(moduleTestFunction, "FunctionListPanel");
            AntdUI.Panel DataFunctionPanel = Tool.GetControlByForm<AntdUI.Panel>(moduleTestFunction, "DataFunctionPanel");
            AntdUI.Panel DataPanel = Tool.GetControlByForm<AntdUI.Panel>(moduleTestFunction, "DataPanel");

            FunctionListPanel.BorderColor = Tool.GetColorBy16("CCCEDB");
            DataFunctionPanel.BorderColor = Tool.GetColorBy16("CCCEDB");
            DataPanel.BorderColor = Tool.GetColorBy16("CCCEDB");

            FunctionListPanel.BackColor = Tool.GetColorBy16("F5F5F5");
            DataFunctionPanel.BackColor = Tool.GetColorBy16("EEEEF2");
            DataPanel.BackColor = Tool.GetColorBy16("FFFFFF");


            FunctionListPanel.Margin=new Padding(0);
            DataFunctionPanel.Margin=new Padding(0);
            DataPanel.Margin=new Padding(0);

            AntdUI.Panel LogoPanel = new AntdUI.Panel();
            AntdUI.Button BrowserConfig=new AntdUI.Button();
            AntdUI.Button ModuleListConfig = new AntdUI.Button();

            LogoPanel.Dock=DockStyle.Top;
            LogoPanel.Height = FunctionListPanel.Width;

            BrowserConfig.Dock= DockStyle.Top;
            BrowserConfig.Text = "浏览器管理";
            BrowserConfig.Name = "BrowserConfig";
            BrowserConfig.Height = 50;

            ModuleListConfig.Dock= DockStyle.Top;
            ModuleListConfig.Text = "任务执行";
            ModuleListConfig.Name = "ModuleListConfig";
            ModuleListConfig.Height = 50;

            FunctionListPanel.Controls.Add(ModuleListConfig);
            FunctionListPanel.Controls.Add(BrowserConfig);
            FunctionListPanel.Controls.Add(LogoPanel);
            
            
            

            AntdUI.Button button= Tool.GetControlByForm<AntdUI.Button>(moduleTestFunction, HowFunctionButtonActive);
            button.BackColor = Tool.GetColorBy16("006CBE");


            userControl = moduleTestFunction;
        }
        public void SaveUserControlImpl() {
            SavePropertiesToParentHashTable();
        }

        //
        private static string HowFunctionButtonActive= "BrowserConfig";
        public string GetHowFunctionButtonActive() {
            return HowFunctionButtonActive;
        }
        public void SetHowFunctionButtonActive(string value) {
            HowFunctionButtonActive = value;
        }
    }
}

